package d.util
{   
    import flash.net.SharedObject;
    
    import mx.collections.ArrayCollection; 
      
    public class RoleUtils 
	{
		public static function getet(): Object {
		   var localet:SharedObject = SharedObject.getLocal("et","/");
	       return localet.data.et;		    
		}
		
		public static function getetByKey(key:String): String {
		   var localet:SharedObject = SharedObject.getLocal("et","/");
	       return localet.data.et[key];			
		}
		
		public static function setet(obj:Object) : void{
		   var localet:SharedObject = SharedObject.getLocal("et","/");
	       localet.data.et = obj;
	       localet.flush();			
		}
		
		public static function getEntitledNodes(): ArrayCollection {
		   var localet:SharedObject = SharedObject.getLocal("et","/");
	       return localet.data.entitledNodes as ArrayCollection;		    
		}
		
		public static function setEntitledNodes(obj:Object) : void{
		   var localet:SharedObject = SharedObject.getLocal("et","/");
	       localet.data.entitledNodes = obj;
	       localet.flush();
		}
		
		public static function setUrls(obj:Object) : void{
		   var urls:SharedObject = SharedObject.getLocal("urls","/");
	       urls.data.urls = obj;
	       urls.flush();			
		}
		
		public static function getUrlByKey(key:String): String {
		   var urls:SharedObject = SharedObject.getLocal("urls","/");
	       return urls.data.urls[key];			
		}
		
		public static function setLoginPage(url:String) : void{
			var sb:SharedObject = SharedObject.getLocal("loginPage");
			sb.data.url = url;
			sb.flush();			
		}
		
		public static function getLoginPage(): String {
			var sb:SharedObject = SharedObject.getLocal("loginPage");
			return sb.data.url;			
		}
		
		public static function setTabs(o:Object) : void{
			var sb:SharedObject = SharedObject.getLocal("tabs");
			sb.data.tabs = o;
			sb.flush();			
		}
		
		public static function getTabs(): Object {
			var sb:SharedObject = SharedObject.getLocal("tabs");
			return sb.data.tabs;			
		}

	}
}